/**
 * Thinking in java 
 *  2018/08/01
 */
package com.dzb.bio;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author dzb
 * @date 2018年8月15日 上午11:27:14
 * @description  
 * @version 1.0.0
 */
public class TimeServerHandlerExecutePool {
	
	private ExecutorService  executorService;
	
	/**
	 * 
	 */
	public TimeServerHandlerExecutePool(int maxPoolSize,int queueSize) {
		executorService = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), 
				maxPoolSize, 120L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(queueSize));
	}
	
	public void execute(Runnable task){
		executorService.execute(task);
	}
	
	

}
